<html>
<head>
<script src="http://testing-ext.mr--js.appspot.com/static/harness.js"></script>
<!-- <script src="http://mrjs.googlecode.com/git/static/harness.js"></script> -->
<script type="text/javascript">
var running = false;
var count = 0;

mrjs.listeners.push(function(obj) {
  if ('error' in obj) {
    chrome.browserAction.setBadgeText({
      text: 'error/done'
    });
  } else if ('items' in obj) {
    count += obj.items.length;
    chrome.browserAction.setBadgeText({
      text: count
    });
  }
});

running = true;
mrjs.start('http://testing-ext.mr--js.appspot.com/serve');

chrome.browserAction.onClicked.addListener(function(tab) {
  if (running) {
    mrjs.stop();
  } else {
    mrjs.start('http://testing-ext.mr--js.appspot.com/serve');
  }
});
</script>
</head>
<body></body>
</html>